﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Platform.Migrations
{
    /// <inheritdoc />
    public partial class add_table_NoDictRule : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_NoDictRule_MainNoDict_NoDictId",
                table: "NoDictRule");

            migrationBuilder.DropPrimaryKey(
                name: "PK_NoDictRule",
                table: "NoDictRule");

            migrationBuilder.RenameTable(
                name: "NoDictRule",
                newName: "MainNoDictRule");

            migrationBuilder.RenameIndex(
                name: "IX_NoDictRule_NoDictId",
                table: "MainNoDictRule",
                newName: "IX_MainNoDictRule_NoDictId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_MainNoDictRule",
                table: "MainNoDictRule",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_MainNoDictRule_MainNoDict_NoDictId",
                table: "MainNoDictRule",
                column: "NoDictId",
                principalTable: "MainNoDict",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MainNoDictRule_MainNoDict_NoDictId",
                table: "MainNoDictRule");

            migrationBuilder.DropPrimaryKey(
                name: "PK_MainNoDictRule",
                table: "MainNoDictRule");

            migrationBuilder.RenameTable(
                name: "MainNoDictRule",
                newName: "NoDictRule");

            migrationBuilder.RenameIndex(
                name: "IX_MainNoDictRule_NoDictId",
                table: "NoDictRule",
                newName: "IX_NoDictRule_NoDictId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_NoDictRule",
                table: "NoDictRule",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_NoDictRule_MainNoDict_NoDictId",
                table: "NoDictRule",
                column: "NoDictId",
                principalTable: "MainNoDict",
                principalColumn: "Id");
        }
    }
}
